package org.darkforest.enums;

/**
 * MemberType
 * Created by Justin on 15/5/23.
 */
public enum MemberType {
    // 会员类型：1 普通会员，2 代理商， 9 员工
    NORMAL(1), MERCHANT(2), EMPLOYEE(9);

    private Integer type;

    private MemberType(Integer type) {
        this.type = type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getType() {
        return type;
    }

    public static MemberType getMemberType(Integer type){
        MemberType memberType = null;
        for(MemberType typeEnum : MemberType.values()){
            if(type!=null && typeEnum.getType()==type){
                memberType = typeEnum;
            }
        }
        return memberType;
    }
}
